package com.wanpinghui.wphlibrary.model.object.bean;

import com.wanpinghui.wphlibrary.model.object.constant.DemandType;
import com.wanpinghui.wphlibrary.model.object.constant.ObjectType;
import com.yunshl.yunshllibrary.utils.NumberUtil;
import com.yunshl.yunshllibrary.utils.TextUtil;

/***
 * 功能描述: 需求信息
 * 作者:qiujialiu
 * 时间:2017/11/23
 ***/
public class DemandBean {
    /**
     * id : 103
     * uid : 9
     * cate : 0 //# 1-安装  2-维修  3-租赁 4采购
     * malf : 0 # 故障分类: 1-整屏或部分不亮   2-出现亮点暗点  3-有色彩问题  4-无法更换屏幕内容  5-屏幕移位
     * type : 1 // # 当cate为1 or 2时: 1-门头屏  2-户外广告屏  3-信息告示屏  4-舞台用屏  5-室内高清屏  0-其他;
     * 当cate为3时: 1-婚礼宴会用屏  2-活动庆典用屏  3-舞台演出用屏  4-会议展览用屏  0-其他
     * surr : 1 # 1-户外   2-室内   3-半户外
     * size : 1.00  # 面积, 单位:平方
     * color : 1 # 1-单色, 2-双色 , 3-全彩
     * span : P13
     * img :
     * prov : 广东省
     * city : 深圳市
     * addr :
     * audio :
     * audio_sensitive : true//# 是否敏感录音
     * budget : 0.00  # 若为0, 则前端显示"议价", 否则显示此预算
     * bid_cnt : 0  # 抢单人数
     * scan_count : 2
     * ip :
     * sem : null
     * tag : 0
     * status : 10 //草稿 0;待审核:5;  竞价中:10;   竞价结束（不能再竞价）:15;  二次竞价中: 20;
     * 免费竞价中:30;  抢单结束: 100;
     * 圆满完成: 200;   无效： 410;
     * remark : sth
     * "price": 8, // 一口价价格
     * sem_keyword : "led维修",
     * created_at : 1491909296
     * updated_at : 1491909296
     * published_at : 1491909296
     * source : 百度寻客 / 官网留电  /  400接入  /  400未接
     * product_type_name_display : 采购产品类名
     * product_name_display : 采购产品名
     * deposit : 采购定金
     * product_amount : 采购数量
     * supply_date : 采购供货期
     * deadline : 竞标截止日期
     * bid_start_point : 竞价起拍点
     * max_bid_point //爆灯汇币数
     * ongoing_bid_seconds //首次竞价时间（秒）
     *  "published_count": 2      // 项目是第几次发布
     *  "win_bid_contact_limit_seconds": 300, // 中标后待联系时长（秒）
     *  publish_remark "{\"1\": \"fff\"}"    // 发布理由, key为第几次发布(从1开始), val为理由
     */
    private long id;
    private int uid;
    private int cate;
    private int malf;
    private int type;
    private int surr;
    private double size;
    private int color;
    private String span;
    private String img;
    private String prov;
    private String city;
    private String addr;
    private String audio;
    private boolean audio_sensitive;
    private double budget;
    private int bid_cnt;
    private int scan_count;
    private String ip;
    private Object sem;
    private int tag;
    private int status;
    private String remark;
    private long created_at;
    private long updated_at;
    private long published_at;
    private String source;
    private String product_type_name_display;
    private String product_name_display;
    private double deposit;
    private int product_amount;
    private String supply_date;
    private String deadline;
    private int bid_start_point;
    private String sem_keyword;
    private int max_bid_point = 200;
    private int ongoing_bid_seconds = 300;
    private int published_count;
    private int win_bid_contact_limit_seconds = 300;
    private String publish_remark;

    public long getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getCate() {
        return cate;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public double getSize() {
        return size;
    }

    public void setSize(double size) {
        this.size = size;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public String getSpan() {
        return span;
    }

    public String getCity() {
        return city;
    }

    public String getAddr() {
        return addr;
    }

    public String getAudio() {
        return audio;
    }

    public void setAudio(String audio) {
        this.audio = audio;
    }

    public boolean isAudio_sensitive() {
        return audio_sensitive;
    }

    public String getSem_keyword() {
        return sem_keyword;
    }

    public double getBudget() {
        return budget;
    }

    public int getBid_cnt() {
        return bid_cnt;
    }

    public int getScan_count() {
        return scan_count;
    }

    public int getTag() {
        return tag;
    }

    public void setTag(int tag) {
        this.tag = tag;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public long getPublished_at() {
        return published_at;
    }

    public String getSource() {
        return source;
    }

    public int getBid_start_point() {
        return bid_start_point;
    }

    public int getMax_bid_point() {
        return max_bid_point;
    }

    public int getOngoing_bid_seconds() {
        return ongoing_bid_seconds;
    }

    public int getPublished_count() {
        return published_count;
    }

    public int getWin_bid_contact_limit_seconds() {
        return win_bid_contact_limit_seconds;
    }

    public String getPublish_remark() {
        return publish_remark;
    }

    public String getCateStr() {
        if (cate == DemandType.TYPE_INSTALL) {
            return "安装";
        }else if (cate == DemandType.TYPE_MAINTAIN) {
            return "维修";
        }else if (cate == DemandType.TYPE_LEASE) {
            return "租赁";
        }else if (cate == DemandType.TYPE_BUY) {
            return "采购";
        }
        return "";
    }

    public String getObjectTypeStr() {
        if (cate == DemandType.TYPE_INSTALL || cate == DemandType.TYPE_MAINTAIN) {
            if (type == ObjectType.TYPE_DOOR_HEAD) {
                return "门头屏";
            }else if (type == ObjectType.TYPE_OUTDOOR_BANNER) {
                return "户外广告屏";
            }else if (type == ObjectType.TYPE_MESSAGE) {
                return "信息告示屏";
            }else if (type == ObjectType.TYPE_STAGE) {
                return "舞台用屏";
            }else if (type == ObjectType.TYPE_INDOOR) {
                return "室内高清屏";
            }else if (type == ObjectType.TYPE_OTHER) {
                return "其他类型屏";
            }
        }else {
            if (type == ObjectType.TYPE_PARTY) {
                return "婚礼宴会用屏";
            }else if (type == ObjectType.TYPE_ACTIVITY) {
                return "活动庆典用屏";
            }else if (type == ObjectType.TYPE_STAGE_PERFORM) {
                return "舞台演出用屏";
            }else if (type == ObjectType.TYPE_CONFERENCE) {
                return "会议展览用屏";
            }else if (type == ObjectType.TYPE_OTHER) {
                return "其他类型屏";
            }
        }
        return "其他类型屏";
    }

    public String getSurroundStr() {
        if (surr == 1) {
            return "户外";
        }else if (surr == 2) {
            return "室内";
        }else if (surr == 3) {
            return "半户外";
        }
        return "";
    }

    public String getColorStr() {
        if (color == 1) {
            return "单色";
        }else if(color == 2) {
            return "双色";
        }else if (color == 3) {
            return "全彩";
        }
        return "";
    }

    //1-整屏或部分不亮   2-出现亮点暗点  3-有色彩问题  4-无法更换屏幕内容  5-屏幕移位
    public String getMalfStr() {
        if (malf == 1) {
            return "整屏或部分不亮";
        }else if (malf == 2) {
            return "出现亮点暗点";
        }else if (malf == 3) {
            return "有色彩问题";
        }else if (malf == 4) {
            return "无法更换屏幕内容";
        }else if (malf == 5) {
            return "屏幕移位";
        }
        return "其它";
    }

    public String getDescription(String separate) {
        String str = "";
        if (TextUtil.isNotEmpty(getSurroundStr())) {
            str = str + getSurroundStr();
        }
        if (TextUtil.isNotEmpty(str)) {
            str += separate+ NumberUtil.double2String(getSize()) +"㎡"+separate+getColorStr();
        }else {
            str = NumberUtil.double2String(getSize()) +"㎡"+separate+getColorStr();
        }
        if (TextUtil.isNotEmpty(getSpan())) {
            str = str+separate+getSpan();
        }
        return str;
    }

    public String getChatTitleDescription() {
        String str = "";
        if (TextUtil.isNotEmpty(getSurroundStr())) {
            str = str + getSurroundStr();
        }
        if (TextUtil.isNotEmpty(str)) {
            str += " | "+ NumberUtil.double2StringAdaptive(getSize()) +"㎡ | "+getColorStr();
        }else {
            str = NumberUtil.double2StringAdaptive(getSize()) +"㎡ | "+getColorStr();
        }
        if (TextUtil.isNotEmpty(getSpan())) {
            str = str+" | "+getSpan();
        }
        return str;
    }

    public String getProv() {
        return prov;
    }
}
